package com.jp.boot.controller;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("book")
public class BookController {


    @PostMapping("/addBook")
    public Map<String, Object> Add(@RequestParam String title,
                                   @RequestParam String author,
                                   @RequestParam String price) {


        System.out.println("title = " + title);
        System.out.println("author = " + author);
        System.out.println("price = " + price);

        return new HashMap<String, Object>() {
            {
                put("code", 200);
                put("data", "OK");
                put("msg", "操作成功");
            }
        };
    }

}
